package model;

import jade.util.leap.Serializable;

public class Product implements Serializable {
	private static final long serialVersionUID = 1L;

	private String name;
	private boolean inProcess;
	private Stage stage;
	private float weight;
	private float volume;
	private float price;
	private int percentage = 100;

	public Product(String name, float weight, float volume, float price, Stage stage) {
		this.name = name;
		this.weight = weight;
		this.volume = volume;
		this.price = price;
		this.stage = stage;
	}

	public String getName() {
		return name;
	}

	public boolean isInProcess() {
		return inProcess;
	}

	public Stage getStage() {
		return stage;
	}

	public float getWeight() {
		return weight;
	}

	public float getVolume() {
		return volume;
	}

	public float getPrice() {
		return price;
	}

	@Override
	public String toString() {
		if (percentage == 100)
			return name;
		else {
			return percentage + "%";
		}
	}

	public void setPercentage(int percentage) {
			this.percentage = percentage;
	}

	public void incrementStage() {
		stage = stage.nextStage();
	}

	public int getPercentage() {
		return percentage;
	}

}
